#!/bin/bash

if [ ! -f util/.serverpod_util_root ]; then
    echo "Run this script from the root of the Serverpod repository"
    echo "I.e. util/create_migrations"
    exit 1
fi

declare -a FLUTTER_PACKAGES_PATHS=(
    "examples/auth/auth_flutter"
    "examples/legacy/auth_example/auth_example_flutter"
    "examples/legacy/chat/chat_flutter"
    "modules/new_serverpod_auth/serverpod_auth_bridge/serverpod_auth_bridge_flutter"
    "modules/new_serverpod_auth/serverpod_auth_core/serverpod_auth_core_flutter"
    "modules/new_serverpod_auth/serverpod_auth_idp/serverpod_auth_idp_flutter"
    "modules/legacy/serverpod_auth/serverpod_auth_apple_flutter"
    "modules/legacy/serverpod_auth/serverpod_auth_email_flutter"
    "modules/legacy/serverpod_auth/serverpod_auth_firebase_flutter"
    "modules/legacy/serverpod_auth/serverpod_auth_google_flutter"
    "modules/legacy/serverpod_auth/serverpod_auth_shared_flutter"
    "modules/legacy/serverpod_chat/serverpod_chat_flutter"
    "packages/serverpod_flutter"
    "templates/serverpod_templates/projectname_flutter"
    "tests/serverpod_new_auth_test/serverpod_new_auth_test_flutter"
    "tests/serverpod_test_flutter"
)

declare -a DART_PACKAGES_PATHS=(
    "packages/serverpod"
    "examples/auth/auth_client"
    "examples/auth/auth_server"
    "examples/legacy/auth_example/auth_example_client"
    "examples/legacy/auth_example/auth_example_server"
    "examples/legacy/chat/chat_client"
    "examples/legacy/chat/chat_server"
    "packages/serverpod_client"
    "packages/serverpod_serialization"
    "packages/serverpod_service_client"
    "packages/serverpod_shared"
    "packages/serverpod_test"
    "tests/serverpod_test_client"
    "tests/serverpod_test_server"
    "tests/serverpod_test_shared"
    "tests/serverpod_test_module/serverpod_test_module_client"
    "tests/serverpod_test_module/serverpod_test_module_server"
    "tests/serverpod_test_nonvector/serverpod_test_nonvector_client"
    "tests/serverpod_test_nonvector/serverpod_test_nonvector_server"
    "tests/bootstrap_project"
    "tests/serverpod_cli_e2e_test"
    "tests/serverpod_new_auth_test/serverpod_new_auth_test_client"
    "tests/serverpod_new_auth_test/serverpod_new_auth_test_server"
    "templates/serverpod_templates/projectname_server"
    "templates/serverpod_templates/projectname_client"
    "templates/serverpod_templates/modulename_server"
    "templates/serverpod_templates/modulename_client"
    "modules/legacy/serverpod_auth/serverpod_auth_server"
    "modules/legacy/serverpod_auth/serverpod_auth_client"
    "modules/new_serverpod_auth/serverpod_auth_idp/serverpod_auth_idp_server"
    "modules/new_serverpod_auth/serverpod_auth_idp/serverpod_auth_idp_client"
    "modules/new_serverpod_auth/serverpod_auth_migration/serverpod_auth_migration_client"
    "modules/new_serverpod_auth/serverpod_auth_migration/serverpod_auth_migration_server"
    "modules/new_serverpod_auth/serverpod_auth_bridge/serverpod_auth_bridge_client"
    "modules/new_serverpod_auth/serverpod_auth_bridge/serverpod_auth_bridge_server"
    "modules/new_serverpod_auth/serverpod_auth_core/serverpod_auth_core_client"
    "modules/new_serverpod_auth/serverpod_auth_core/serverpod_auth_core_server"
    "modules/legacy/serverpod_chat/serverpod_chat_server"
    "modules/legacy/serverpod_chat/serverpod_chat_client"
    "integrations/serverpod_cloud_storage_s3"
    "integrations/serverpod_cloud_storage_gcp"
    "tools/serverpod_cli"
)

declare -a SERVERPOD_SERVER_PATHS=(
    "packages/serverpod"
    "examples/legacy/chat/chat_server"
    "examples/auth/auth_server"
    "examples/middleware/middleware_server"
    "examples/legacy/auth_example/auth_example_server"
    "modules/legacy/serverpod_auth/serverpod_auth_server"
    "modules/new_serverpod_auth/serverpod_auth_core/serverpod_auth_core_server"
    "modules/new_serverpod_auth/serverpod_auth_idp/serverpod_auth_idp_server"
    "modules/new_serverpod_auth/serverpod_auth_bridge/serverpod_auth_bridge_server"
    "modules/new_serverpod_auth/serverpod_auth_migration/serverpod_auth_migration_server"
    "modules/legacy/serverpod_chat/serverpod_chat_server"
    "tests/serverpod_test_server"
    "tests/serverpod_test_module/serverpod_test_module_server"
    "tests/serverpod_test_nonvector/serverpod_test_nonvector_server"
    "tests/serverpod_new_auth_test/serverpod_new_auth_test_server"
)

declare -a SERVERPOD_SERVER_EXPERIMENTAL_PATHS=(
    "tests/serverpod_test_server"
    "tests/serverpod_test_module/serverpod_test_module_server"
    "tests/serverpod_test_nonvector/serverpod_test_nonvector_server"
)

declare -a SERVERPOD_TEMPLATE_SERVERS=(
    "templates/serverpod_templates/modulename_server"
    "templates/serverpod_templates/projectname_server"
    "templates/serverpod_templates/projectname_server_upgrade"
)
